/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.logiclander.whozwho.core.jaxrs.ext.base;

/**
 *
 * @author logiclander
 */
public class WebPreconditions {

  private WebPreconditions() {
  }

  public static void checkWebArgument(boolean expression) {
    if (!expression) {
      throw new BadRequestException();
    }
  }

  public static void checkWebArgument(boolean expression,
          RestQueryKey queryKey) {
    if (!expression) {
      throw new BadRequestException(queryKey);
    }
  }

  public static void checkWebArgument(boolean expression, String message) {
    if (!expression) {
      throw new BadRequestException(message);
    }
  }

  public static void checkWebArgument(boolean expression,
          RestQueryKey queryKey, String message) {
    if (!expression) {
      throw new BadRequestException(queryKey, message);
    }
  }
}
